<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	template="/WEB-INF/layout/t.xhtml">

	<ui:define name="title">
		<h:outputText value="Scheda Menu" />
	</ui:define>
	<ui:define name="roles">
		<f:attribute name="roles" value="menu" />
	</ui:define>
	<ui:define name="content">
		<h:form>
			<center>

				<p:panel header="Scheda Menu">
					<h:panelGrid columns="2" style="width: 95%">

						<h:outputLabel value="Nome:" for="nome" />
						<h:outputText id="nome" value="#{menuController.element.name}"
							style="width: 100%;" />

						<h:outputLabel value="Descrizione:" for="descrizione" />
						<h:outputText id="descrizione"
							value="#{menuController.element.description}"
							style="width: 100%;" />

						<h:outputLabel value="Percorso:" for="percorso" />
						<h:outputText id="percorso"
							value="#{menuController.element.path}" style="width: 100%;" />

					</h:panelGrid>
					<br />

					<p:dataTable id="pagesList" rowIndexVar="rowIndex" var="item"
						value="#{menuController.element.list}">
						<p:column>
							<f:facet name="header">
								<h:outputText value="ordinamento" />
							</f:facet>
							<h:outputText value="#{item.sortOrder}" />
						</p:column>
						<p:column width="200">
							<f:facet name="header">
							nome
						</f:facet>
							<h:outputText value="#{item.name}" />
						</p:column>
						<p:column width="300">
							<f:facet name="header">
							percorso
						</f:facet>
							<h:outputText value="#{item.path}" />
						</p:column>
						<p:column width="200">
							<f:facet name="header">
							id_pagina
						</f:facet>
							<h:outputText value="#{item.page.id}" />
						</p:column>
					</p:dataTable>

				</p:panel>

				<br /> <br />

				<h:panelGrid columns="2">

					<h:commandButton action="#{menuController.modCurrent}"
						value="Modifica" immediate="false" />

					<h:commandButton id="reset" action="#{menuController.reset}"
						value="Indietro" immediate="true" rendered="false" />

				</h:panelGrid>
			</center>

		</h:form>
	</ui:define>
</ui:composition>